<div class="portfolios-list">
	<h2 class="hide"><?php __('Portfolios');?></h2>
	<div class="nav">
		<ul>
			<li <?php if($active == 'all'): ?>class="active"<?php endif; ?>><?php echo $html->link(__('All', true), array('action'=>'index'), array('class'=>'first')); ?></li>
			<?php foreach($categories as $slug => $title ):?>
				<li <?php if($active == $slug): ?>class="active"<?php endif; ?>><?php echo $html->link($title, array('action'=>'index', $slug)); ?></li>
			<?php endforeach; ?>
		</ul>
	</div>
	<div class="holder">
		<?php $num = 1; foreach ($portfolios as $portfolio): ?>
			<?php 
			
			$class = "";
			if($num == 1) {
				$class = "left";
			} 
			$num++;
			if($num == 5) {
				$num = 1;
			}
			?>
			<a href="<?php echo $html->url(array('action'=>'view', $portfolio['Portfolio']['slug'])); ?>" class="<?php echo $class; ?>">
				<?php if( isset($portfolio['Upload'][0]['filename']) ): ?>
					<span class="border">
						<span class="crop">
					<?php $full = $portfolio['Upload'][0]['dir'] . DS . $portfolio['Upload'][0]['filename'];
					echo $gershImage->resize($full, 'portfolio_list', array('title' => $portfolio['Upload'][0]['title'],'alt' => $portfolio['Upload'][0]['title']));?>
						</span>
					</span>
				<?php endif; ?>
				<?php echo $portfolio['Portfolio']['title']; ?>
				<span class="date"><?php echo date('M Y', $time->toUnix($portfolio['Portfolio']['date'])); ?></span>
			</a>
		<?php endforeach; ?>
	</div>
	<?php if(isset($paginator)):?>
	<div class="paging">
		<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $paginator->numbers();?>
		<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
	</div>
	<?php endif; ?>
</div>